{extend name="default/base/base_home" /}
{block name="mall_main"}


<link rel="stylesheet" href="{$Think.BASE_SITE_ROOT}/static/home/default/store/styles/{$store_theme}/css/shop.css">
<link rel="stylesheet" href="{$Think.BASE_SITE_ROOT}/static/home/default/store/styles/{$store_theme}/css/goods.css">
<!--放大镜BEGIN-->
<link rel="stylesheet" href="{$Think.BASE_SITE_ROOT}/static/home/default/store/styles/{$store_theme}/css/jquery.jqzoom.css">
<!--放大镜END-->
<div class="w1200">
    <div class="dss-detail clearfix">
        <div class="intro_l">
            <div class="preview" id="photoBody">
                <!-- 商品大图介绍 start [[-->
                <div class="product-img jqzoom">
                    <img id="zoomimg" src="{$goods_image.0.2}" jqimg="{$goods_image.0.2}" alt="">
                </div>
                <!-- 商品大图介绍 end ]]-->
                <!-- 商品小图介绍 start [[-->
                <div class="product-small-img fn-clear"> <a href="javascript:;" class="next-left next-btn fl iconfont">&#xe686;</a>
                    <div class="pic-hide-box fl">
                        <ul class="small-pic" style="left:0;">
                            {foreach name="goods_image" item="value" key="key" }
                            <li class="small-pic-li {if $key==0}active{/if}">
                                <a href="javascript:;">
                                    <img src="{$value.0}" data-img="{$value.2}" data-big="{$value.2}">
                                    <i></i>
                                </a>
                            </li>
                            {/foreach}
                        </ul>
                    </div>
                    <a href="javascript:;" class="next-right next-btn fl iconfont">&#xe687;</a>
                </div>
                <!-- 商品小图介绍 end ]]-->
            </div>
            <!-- E 商品图片及收藏分享 -->
            <div class="dss-handle">
                <!-- S 收藏 -->
                <a href="javascript:collect_goods('{$goods.goods_id}','count','goods_collect');" class="favorite"><i class="iconfont">&#xe6a9;</i>{$Think.lang.goods_index_favorite_goods}</a>
                <!-- S 对比 -->
                <input type="hidden" id="lockcompare" value="unlock" />
                <a href="javascript:void(0);" class="compare" ds_type="compare_{$goods.goods_id}" data-param='{"gid":"{$goods.goods_id}"}'><i class="iconfont">&#xe74a;</i>{$Think.lang.add_contrast}</a><!-- S 举报 -->
                {if $inform_switch}
                <a href="{if $Think.session.is_login}{:url('Memberinform/inform_submit',['goods_id'=>$goods.goods_id])}{else/}javascript:login_dialog();{/if}" title="{$Think.lang.goods_index_goods_inform}" class="inform"><i class="iconfont">&#xe6b3;</i>{$Think.lang.goods_index_goods_inform}</a>
                {/if}
                <!-- End -->
            </div>
        </div>
        <div class="dss-goods-summary">
            <div class="name">
                <h1>{$goods.goods_name}</h1>
                <strong>{$goods.goods_advword}</strong>
            </div>
            <div class="dss-meta">
                {if $goods.goods_marketprice > 0}
                <dl>
                    <dt>{$Think.lang.goods_index_goods_cost_price}</dt>
                    <dd class="marketprice"><del>{$Think.lang.currency}{$goods.goods_marketprice}</del></dd>
                </dl>
                {/if}
                <dl>
                    <dt>{$Think.lang.goods_index_goods_price}</dt>
                    <dd class="price">
                        <span class="currency">{$Think.lang.currency}</span>
                        {notempty name="$goods.promotion_price"}
                        <strong>{:ds_price_format($goods['promotion_price'])}</strong>
                        {else/}
                        <strong>{:ds_price_format($goods['goods_price'])}</strong>
                        {/notempty}
                    </dd>
                </dl>


            </div>
            <?php if($goods['goods_state'] != 10 && $goods['goods_verify'] == 1){?>
            <!-- S 促销 -->
            <?php if (isset($goods['promotion_type']) || $goods['is_have_gift'] == 'gift'  || !empty($mansong_info)) {?>
            <div class="dss-sale">
                <?php if (isset($goods['promotion_type']) || !empty($mansong_info)) {?>
                <dl>
                    <dt>{$Think.lang.promotion_all_corners}</dt>
                    <dd class="promotion-info">
                        {notempty name="$goods.promotion_type"}
                        <span class="sale-name">{$goods.title}</span>
                        <!-- S 限时折扣 -->
                        {if $goods.promotion_type == 'xianshi'}
                        <span class="sale-rule w400">{$Think.lang.vertical_drop}<em>{$Think.lang.currency}{:ds_price_format($goods['down_price'])}</em>
            {if $goods.lower_limit}
            {:sprintf(lang('lowest_thing'),$goods['lower_limit'])}
            {if $goods.explain}
            ，{$goods.explain}
            {/if}
            {/if}
            </span>
                        <div class="clearfix"></div>
                        {/if}
                        <!-- E 限时折扣  -->
                        {/notempty}

                        <!--S 满就送 -->
                        {if $mansong_info}
                        <div class="dss-mansong"> <span class="sale-name">{$Think.lang.ds_mansong}</span> <span class="sale-rule">
              <?php $rule = $mansong_info['rules'][0];?>{$Think.lang.ds_man}
              <em>{$Think.lang.currency}{:ds_price_format($rule['mansongrule_price'])}</em>
              {notempty name="$rule.mansongrule_discount"}，{$Think.lang.ds_reduce}<em>{$Think.lang.currency}{:ds_price_format($rule['mansongrule_discount'])}</em>{/notempty}
              {if $rule.goods_id && isset($rule['goods_storage']) && $rule['goods_storage']}，{$Think.lang.ds_gift}{/if}
              </span><div class="clearfix"></div> <span class="sale-rule-more" dstype="show-rule"><a href="javascript:void(0);">{$Think.lang.total}<strong>{:count($mansong_info['rules'])}</strong>{$Think.lang.expand_view}<i class="iconfont">&#xe689;</i></a></span>
                            <div class="sale-rule-content" style="display: none;" dstype="rule-content">
                                <div class="title"><span class="sale-name">{$Think.lang.ds_mansong}</span>{$Think.lang.total}<strong>{:count($mansong_info['rules'])}</strong>{$Think.lang.promotional_campaign_rules}<a href="javascript:;" dstype="hide-rule">{$Think.lang.ds_close}</a></div>
                                <div class="content">
                                    <div class="mjs-tit">{$mansong_info.mansong_name}
                                        <time>( {$Think.lang.ds_promotion_time}:{$mansong_info.mansong_starttime|date="Y-m-d",###} - {$mansong_info.mansong_endtime|date="Y-m-d",###} )</time>
                                    </div>
                                    <ul class="mjs-info">
                                        {foreach name="$mansong_info.rules" item="rule" }
                                        <li> <span class="sale-rule">{$Think.lang.ds_man}<em>{$Think.lang.currency}{:ds_price_format($rule['mansongrule_price'])}</em>
                      {notempty name="$rule.mansongrule_discount"}， {$Think.lang.ds_reduce}<em>{$Think.lang.currency}{:ds_price_format($rule['mansongrule_discount'])}</em>{/notempty}
                      {if $rule.goods_id && isset($rule['goods_storage']) && $rule['goods_storage']}
                      ， {$Think.lang.ds_gift} <a href="{$rule.goods_url}" title="{$rule.mansong_goods_name}" target="_blank" class="gift"> <img src="{:goods_cthumb($rule['goods_image'], 240)}" alt="{$rule.mansong_goods_name}"> </a>&nbsp;。
                      {/if}
                      </span> </li>
                                        {/foreach}
                                    </ul>
                                    <div class="mjs-remark">{$mansong_info.mansong_remark}</div>
                                </div>
                            </div>
                        </div>
                        {/if}
                        <!--E 满就送 -->

                    </dd>
                </dl>
                <?php }?>

                {if $goods['inviter_amount']>0}
                <dl>
                    <dt>{$Think.lang.distribution_commission}</dt>
                    <dd>{$Think.lang.currency}{:ds_price_format($goods['inviter_amount'])}</dd>
                </dl>
                {/if}
                <dl>
                    <dt>{$Think.lang.goods_index_evaluation}</dt>
                    <dd><a href="#dsGoodsRate">{$Think.lang.total}{$goods.evaluation_count}{$Think.lang.article_evaluation}</a></dd>
                </dl>
                <!-- S 赠品 -->
                {if $goods.is_have_gift}
                <dl>
                    <dt>{$Think.lang.gift_all_corners}</dt>
                    <dd class="goods-gift" id="dssGoodsgift"> <span>{$Think.lang.end_gift}</span>
                        {notempty name="gift_array"}
                        <ul>
                            {foreach name="gift_array" item="val" }
                            <li>
                                <div class="goods-gift-thumb"><span><img src="{:goods_cthumb($val['gift_goodsimage'], '240', $goods['store_id'])}"></span></div>
                                <a href="{:url('Goods/index',['goods_id'=>$val.gift_goodsid])}" class="goods-gift-name" target="_blank" title="{$val.gift_goodsname}"></a><em>x{$val.gift_amount}</em> </li>
                            {/foreach}
                        </ul>
                        {/notempty}
                    </dd>
                </dl>
                {/if}
                <!-- E 赠品 -->

            </div>
            <?php }?>
            <!-- E 促销 -->

            <!--送达时间 begin  -->
            {if $store_info.store_free_time >= '1'}
            <dl>
                <dt>{$Think.lang.service_all_corners}</dt>
                <dd>{$Think.lang.by} <a href="{:url('Store/index',['store_id'=>$store_info.store_id])}" title="{$Think.lang.enter_store}" ><font color="#D93600"><b>{$store_info.store_name}</b></font></a> {$Think.lang.shipping_prompt1}<span id="store-free-time">{$Think.lang.shipping_prompt2}(<font color="#D93600"><b>
            <?php $showtime=date("Y-m-d H:i:s"); echo date("m".lang('ds_month')."d".lang('ds_day'),strtotime($showtime . '+'. $store_info['store_free_time'].' day')); ?>
            </b></font>) {$Think.lang.service}</span></dd>
            </dl>
            {/if}
            <!--送达时间 end  -->

            
            <div class="dss-key">

                <!-- S 商品规格值-->
                {notempty name="$goods.spec_name"}
                {foreach name="$goods.spec_name" item="val" key="key" }
                <?php if (isset($goods['spec_value'][$key]) and is_array($goods['spec_value'][$key]) and !empty($goods['spec_value'][$key])) {?>
                <dl dstype="ds-spec">
                    <dt>{$val}</dt>
                    <dd>
                        <ul nctyle="ul_sign">
                            <?php foreach($goods['spec_value'][$key] as $k => $v) {?>
                            {if  $key == 1 }
                            <!-- 图片类型规格-->
                            <li class="sp-img"><a href="javascript:void(0);" class="<?php if (isset($goods['goods_spec'][$k])) {echo 'hovered';}?>" data-param="{valid:{$k}}" title="{$v}"><img src="<?php echo $spec_image[$k];?>"/>{$v}<i></i></a></li>
                            {else /}
                            <!-- 文字类型规格-->
                            <li class="sp-txt"><a href="javascript:void(0)" class="<?php if (isset($goods['goods_spec'][$k])) { echo 'hovered';} ?>" data-param="{valid:{$k}}">{$v}<i></i></a></li>
                            {/if}
                            <?php }?>
                        </ul>
                    </dd>
                </dl>
                <?php }?>
                {/foreach}
                {/notempty}
                <!-- E 商品规格值-->
            </div>
            <!-- S 购买数量及库存 -->
            <div class="dss-buy">
                <?php if ($goods['goods_state'] != 0 && $goods['goods_storage'] >= 0) {?>
                <div class="dss-figure-input">
                    <a href="javascript:void(0)" class="decrease iconfont" dstype="decrease">&#xe6dc;</a>
                    <input type="text" name="" id="quantity" value="1" size="3" maxlength="6" class="input-text">
                    <a href="javascript:void(0)" class="increase iconfont" dstype="increase">&#xe6db;</a>
                </div>
                <div class="dss-point" style="display: none;"><i></i>
                    <!-- S 库存 -->
                    <span>{$Think.lang.selected_item_stock}<strong dstype="goods_stock">{$goods.goods_storage}</strong>{$Think.lang.ds_jian}</span>
                </div>
                <?php } ?>

                <!-- E 提示已选规格及库存不足无法购买 -->
                <div class="dss-btn">
                    <!-- 限制购买-->
                    <!-- 加入购物车-->
                    {if $goods.cart == true}
                    <a href="javascript:void(0);" dstype="addcart_submit" class="addcart {if $goods['goods_state'] == 0 || $goods['goods_storage'] <= 0}no-addcart{/if}" title="{$Think.lang.goods_index_add_to_cart}"><i class="iconfont">&#xe69a;</i>{$Think.lang.goods_index_add_to_cart}</a>
                    {/if}
                    <!-- 立即购买-->
                    <a href="javascript:void(0);" dstype="buynow_submit" class="buynow <?php if ($goods['goods_state'] == 0 || $goods['goods_storage'] <= 0) {?>no-buynow<?php }?>" title="{$goods.buynow_text}">{$goods.buynow_text}</a>

                    <!-- end-->

                    <!-- S 加入购物车弹出提示框 -->
                    <div class="dss-cart-popup">
                        <dl>
                            <dt>{$Think.lang.goods_index_cart_success}<a title="{$Think.lang.goods_index_close}" onClick="$('.dss-cart-popup').css({'display':'none'});">X</a></dt>
                            <dd> {$Think.lang.goods_index_cart_have}<strong id="bold_num"></strong>  {$Think.lang.goods_index_number_of_goods}{$Think.lang.goods_index_total_price}:<em id="bold_mly" class="saleP"></em></dd>
                            <dd class="btns">
                                <a href="javascript:void(0);" class="dss-btn-mini dss-btn-green" onclick="location.href='{:url('Cart/index')}'">{$Think.lang.goods_index_view_cart}</a>
                                <a href="javascript:void(0);" class="dss-btn-mini" value="" onclick="$('.dss-cart-popup').css({'display':'none'});">{$Think.lang.goods_index_continue_shopping}</a>
                            </dd>
                        </dl>
                    </div>
                    <!-- E 加入购物车弹出提示框 -->
                </div>
                <!-- E 购买按钮 -->
                <div class="qrcode_btn iconfont">&#xe72d;
                    <div class="dss-goods-code">
                        <div class="qrcode">
                            <img src="{$Think.HOME_SITE_URL}/qrcode?url={:urlencode($Think.config.h5_site_url)}%2fhome%2fgoodsdetail%3fgoods_id%3d{$goods.goods_id}"/>
                        </div>
                        <p>{$Think.lang.mobile_end_purchase}</p>
                        <b class="iconfont">&#xe687;</b>
                    </div>
                </div>
            </div>
            <?php }else{?>
            <div class="dss-buy">
                <div class="dss-saleout">
                    <dl>
                        <dt><i class="iconfont">&#xe73b;</i>{$Think.lang.goods_index_is_no_show}</dt>
                        <dd>{$Think.lang.goods_index_is_no_show_message_one}</dd>
                        <dd>{$Think.lang.goods_index_is_no_show_message_two_1}&nbsp;<a href="{:url('Store/index',['store_id'=>$goods.store_id])}" class="dsbtn-mini">{$Think.lang.goods_index_is_no_show_message_two_2}</a>&nbsp;{$Think.lang.goods_index_is_no_show_message_two_3} </dd>
                    </dl>
                </div>
            </div>
            <?php }?>
            <!-- E 购买数量及库存 -->
        </div>
        
        

        <div class="intro_r">
            <div class="mt">
                <h2>看了又看</h2>
                <span></span>
            </div>
            <div class="mc">
                <ul>
                    {foreach name="goods_commend" item="goods_commend_child" }
                    <li>
                        <div class="p_img">
                            <a href="{:url('Goods/index',['goods_id'=>$goods_commend_child.goods_id])}" target="_blank" title="{$goods_commend_child.goods_advword}">
                                <img src="{:goods_thumb($goods_commend_child, 240)}" alt="{$goods_commend_child.goods_name}"/>
                            </a>
                            <div class="p_name">{$goods_commend_child.goods_name}</div>
                        </div>
                        <div class="p_price">
                            {$Think.lang.currency}{$goods_commend_child.goods_price}
                        </div> 
                    </li>
                    {/foreach}
                </ul>
            </div>
            <div class="mb">
                <a class="next" href="javascript:void(0)"><i class="iconfont">&#xe688;</i></a>
                <a class="prev" href="javascript:void(0)"><i class="iconfont">&#xe689;</i></a>
            </div>
        </div>
        
        
        
        


    </div>

    <div id="content" class="dss-goods-layout expanded" >
        <div class="dss-goods-main" id="main-nav-holder">
            <div class="tabbar pngFix" id="main-nav">
                <div class="dss-goods-title-nav">
                    <ul id="categorymenu">
                        <li class="current"><a id="tabGoodsIntro" href="#content">{$Think.lang.goods_index_goods_info}</a></li>
                        <li><a id="tabGoodsRate" href="#content">{$Think.lang.goods_index_evaluation}<em>({$goods_evaluate_info.all})</em></a></li>
                        <li><a id="tabGoodsTraded" href="#content">{$Think.lang.goods_index_sold_record}<em>({$goods.goods_salenum})</em></a></li>
                        <li><a id="tabGuestbook" href="#content">{$Think.lang.goods_index_goods_consult}</a></li>
                    </ul>
                </div>
            </div>
            <div class="dss-intro">
                <div class="content bd" id="dsGoodsIntro">
                    <?php if(is_array($goods['goods_attr']) || isset($goods['brand_name'])){?>
                    <ul class="ds-goods-sort">
                        <?php if ($goods['goods_serial']) {?>
                        <li>{$Think.lang.merchant_item_number}：{$goods.goods_serial}</li>
                        <?php }?>
                        <?php if(isset($goods['brand_name'])){echo '<li>'.lang('goods_index_brand').lang('ds_colon').$goods['brand_name'].'</li>'; } ?>
                        <?php if(is_array($goods['goods_attr']) && !empty($goods['goods_attr'])){ ?>
                        <?php foreach ($goods['goods_attr'] as $val){ $val= array_values($val);echo '<li>'.$val[0].lang('ds_colon').$val[1].'</li>'; } ?>
                        <?php }?>
                    </ul>
                    <?php }?>
                    <div class="dss-goods-info-content">
                        {if isset($plate_top)}
                        <div class="top-template">{$plate_top.storeplate_content|htmlspecialchars_decode}</div>
                        {/if}
                        <div class="default">{$goods.goods_body|htmlspecialchars_decode}</div>
                        {if isset($plate_bottom)}
                        <div class="bottom-template">{$plate_bottom.storeplate_content|htmlspecialchars_decode}</div>
                        {/if}
                    </div>
                </div>
            </div>
            <div class="dss-comment">
                <div class="dss-goods-title-bar hd" style="display: none">
                    <h4><a href="javascript:void(0);">{$Think.lang.goods_index_evaluation}</a></h4>
                </div>
                <div class="dss-goods-info-content bd" id="dsGoodsRate" style="display: none">
                    <div class="dss-top">
                        <div class="rate">
                            <p><strong>{$goods_evaluate_info.good_percent}</strong><sub>%</sub>{$Think.lang.high_praise}</p>
                            <span>{$Think.lang.total}{$goods_evaluate_info.all}{$Think.lang.people_participation_rating}</span></div>
                        <div class="percent">
                            <dl>
                                <dt>{$Think.lang.high_praise}<em>({$goods_evaluate_info.good_percent}%)</em></dt>
                                <dd><i style="width: {$goods_evaluate_info.good_percent}%"></i></dd>
                            </dl>
                            <dl>
                                <dt>{$Think.lang.medium_rating}<em>({$goods_evaluate_info.normal_percent}%)</em></dt>
                                <dd><i style="width: {$goods_evaluate_info.normal_percent}%"></i></dd>
                            </dl>
                            <dl>
                                <dt>{$Think.lang.poor_rating}<em>({$goods_evaluate_info.bad_percent}%)</em></dt>
                                <dd><i style="width: {$goods_evaluate_info.bad_percent}%"></i></dd>
                            </dl>
                        </div>
                        <div class="btns"><span>{$Think.lang.evaluation_purchased_goods}</span>
                            <p><a href="{:url('Memberorder/index')}" class="dss-btn dss-btn-red" target="_blank"><i class="iconfont">&#xe71b;</i>{$Think.lang.evaluation_item}</a></p>
                        </div>
                    </div>
                    <div class="dss-goods-title-nav">
                        <ul id="comment_tab">
                            <li data-type="all" class="current"><a href="javascript:void(0);">{$Think.lang.goods_index_evaluation}({$goods_evaluate_info.all})</a></li>
                            <li data-type="1"><a href="javascript:void(0);">{$Think.lang.high_praise}({$goods_evaluate_info.good})</a></li>
                            <li data-type="2"><a href="javascript:void(0);">{$Think.lang.medium_rating}({$goods_evaluate_info.normal})</a></li>
                            <li data-type="3"><a href="javascript:void(0);">{$Think.lang.poor_rating}({$goods_evaluate_info.bad})</a></li>
                        </ul>
                    </div>
                    <!-- 商品评价内容部分 -->
                    <div id="goodseval" class="dss-commend-main"></div>
                </div>
            </div>
            <div class="dsg-salelog">
                <div class="dss-goods-title-bar hd" style="display: none">
                    <h4><a href="javascript:void(0);">{$Think.lang.goods_index_sold_record}</a></h4>
                </div>
                <div class="dss-goods-info-content bd" id="dsGoodsTraded" style="display: none">

                    <!-- 成交记录内容部分 -->
                    <div id="salelog_demo" class="dss-loading"> </div>
                </div>
            </div>
            <div class="dss-consult">
                <div class="dss-goods-title-bar hd" style="display: none">
                    <h4><a href="javascript:void(0);">{$Think.lang.goods_index_goods_consult}</a></h4>
                </div>
                <div class="dss-goods-info-content bd" id="dsGuestbook" style="display: none">
                    <!-- 咨询留言内容部分 -->
                    <div id="consulting_demo" class="dss-loading"> </div>
                </div>
            </div>
            {notempty name="goods_commend"}
            <div class="dss-recommend">
                <div class="title">
                    <h4>{$Think.lang.goods_index_goods_commend}</h4>
                </div>
                <div class="content">
                    <ul>
                        {foreach name="goods_commend" item="goods_commend_child" }
                        {neq name='goods.goods_id' value="$goods_commend_child.goods_id"}
                        <li>
                            <dl>
                                <dt class="goods-name"><a href="{:url('Goods/index',['goods_id'=>$goods_commend_child.goods_id])}" target="_blank" title="{$goods_commend_child.goods_advword}">{$goods_commend_child.goods_name}<em>{$goods_commend_child.goods_advword}</em></a></dt>
                                <dd class="goods-pic"><a href="{:url('Goods/index',['goods_id'=>$goods_commend_child.goods_id])}" target="_blank" title="{$goods_commend_child.goods_advword}"><img class="lazyload" data-original="{:goods_thumb($goods_commend_child, 240)}" alt="{$goods_commend_child.goods_name}"/></a></dd>
                                <dd class="goods-price">{$Think.lang.currency}{$goods_commend_child.goods_price}</dd>
                            </dl>
                        </li>
                        {/neq}
                        {/foreach}

                    </ul>
                    <div class="clear"></div>
                </div>
            </div>
            {/notempty}
        </div>
        <div class="dss-sidebar">



            {include file="default/store/default/store/store_info"}
            <div class="dss-message-bar">
                <div class="common_title">
                    <h2>{$Think.lang.ds_message_center}</h2>
                </div>

                {if !empty($store_info['store_presales']) || !empty($store_info['store_aftersales']) || $store_info['store_workingtime'] !=''}
                <div class="service-list" store_id="{$store_info.store_id}" store_name="{$store_info.store_name}">
                    {notempty name="$store_info.store_presales"}
                    <dl>
                        <dt>{$Think.lang.ds_message_presales}</dt>
                        {foreach name="$store_info.store_presales" item="val" }
                        <dd><span>{$val.name}</span><span>
                          {if $val.type == 1}
                          <a target="_blank" href="{$Think.HTTP_TYPE}wpa.qq.com/msgrd?v=3&uin={$val.num}&site=qq&menu=yes" title="QQ: {$val.num}"><img border="0" src="{$Think.HTTP_TYPE}wpa.qq.com/pa?p=2:{$val.num}:51" style=" vertical-align: middle;"/></a>
                          {elseif $val.type ==2 /}
                          <a target="_blank" href="http://amos.im.alisoft.com/msg.aw?v=2&amp;uid={$val.num}&site=cntaobao&s=1&charset=UTF-8" ><img border="0" src="http://amos.im.alisoft.com/online.aw?v=2&uid={$val.num}&site=cntaobao&s=2&charset=UTF-8" alt="{$Think.lang.ds_message_me}"/></a>
                          {elseif $val.type==3 /}
                          <span c_name="{$val.name}" member_id="{$val.num}"></span>
                          {/if}
                      </span></dd>
                        {/foreach}
                    </dl>
                    {/notempty}
                    {notempty name="$store_info.store_aftersales"}
                    <dl>
                        <dt>{$Think.lang.ds_message_service}</dt>
                        {foreach name="$store_info.store_aftersales" item="val" }
                        <dd><span>{$val.name}</span>
                            <span>
                          {if $val.type == 1}
                          <a href="{$Think.HTTP_TYPE}wpa.qq.com/msgrd?v=3&uin={$val.num}&site=qq&menu=yes" title="QQ: {$val.num}" target="_blank"><img border="0" src="{$Think.HTTP_TYPE}wpa.qq.com/pa?p=2:{$val.num}:52" alt="{$Think.lang.ds_message_me}" style=" vertical-align: middle;"></a>
                          {elseif $val.type ==2 /}
                          <a target="_blank" href="http://amos.im.alisoft.com/msg.aw?v=2&amp;uid={$val.num}&site=cntaobao&s=1&charset=UTF-8" ><img border="0" src="http://amos.im.alisoft.com/online.aw?v=2&uid={$val.num}&site=cntaobao&s=2&charset=UTF-8" alt="{$Think.lang.ds_message_me}"/></a>
                          {elseif $val.type==3 /}
                          <span c_name="{$val.name}" member_id="{$val.num}"></span>
                          {/if}
                      </span>
                        </dd>
                        {/foreach}
                    </dl>
                    {/notempty}
                    {if $store_info.store_workingtime !=''}
                    <dl class="workingtime">
                        <dt>{$Think.lang.ds_message_working}</dt>
                        <dd>
                            <p>{:html_entity_decode($store_info['store_workingtime'])}</p>
                        </dd>
                    </dl>
                    {/if}
                </div>
                {/if}
            </div>





            <div class="common_module">
                <div class="common_title">
                    <h2>{$Think.lang.ds_hot_goods_rankings}</h2>
                </div>
                <div class="common_content">
                    <ul>
                        {foreach name="hot_sales" item="val"}
                        <li>
                            <div class="p_img">
                                <a href="{:url('Goods/index',['goods_id'=>$val.goods_id])}"><img src="{:goods_thumb($val, 240)}" width="85" height="85"></a>
                            </div>
                            <div class="p_num {if $key < 3 }active{/if}">{php}echo $key+1;{/php}</div>
                            <div class="p_info">
                                <div class="p_name">
                                    <a href="{:url('Goods/index',['goods_id'=>$val.goods_id])}">{$val.goods_name}</a>
                                </div>
                                <div class="p_price">{$Think.lang.currency}<em>{$val.goods_promotion_price}</em></div>
                                <div class="p_sales">{$Think.lang.ds_sell_out}<strong>{$val.goods_salenum}</strong>{$Think.lang.ds_bi}</div>
                            </div>
                        </li>
                        {/foreach}
                    </ul>
                </div>
            </div>
            <div class="common_module">
                <div class="common_title">
                    <h2>{$Think.lang.ds_hot_collect_rankings}</h2>
                </div>
                <div class="common_content">
                    <ul>
                        {foreach name="hot_collect" key="key" item="val"  }
                        <li>
                            <div class="p_img">
                                <a href="{:url('Goods/index',['goods_id'=>$val.goods_id])}"><img src="{:goods_thumb($val, 240)}" width="85" height="85"></a>
                            </div>
                            <div class="p_num {if $key < 3 }active{/if}">{php}echo $key+1;{/php}</div>
                            <div class="p_info">
                                <div class="p_name">
                                    <a href="{:url('Goods/index',['goods_id'=>$val.goods_id])}">{$val.goods_name}</a>
                                </div>
                                <div class="p_price">{$Think.lang.currency}<em>{$val.goods_promotion_price}</em></div>
                                <div class="p_sales">{$Think.lang.ds_collection_popularity}{$Think.lang.ds_colon}<strong>{$val.goods_collect}</strong></div>
                            </div>
                        </li>
                        {/foreach}
                    </ul>
                </div>
            </div>
            <!--侧边推荐 END-->





            {if isset($viewed_goods)}
            <!-- 最近浏览 -->
            <div class="dss-sidebar-container dss-top-bar">
                <div class="title">
                    <h4>{$Think.lang.recent_browsing}</h4>
                </div>
                <div class="content">
                    <div id="hot_sales_list" class="dss-top-panel">
                        <ol>
                            {foreach name="viewed_goods" item="g"  }
                            <li>
                                <dl>
                                    <dt><a href="{:url('Goods/index',['goods_id'=>$g.goods_id])}">{$g.goods_name}</a></dt>
                                    <dd class="goods-pic"><a href="{:url('Goods/index',['goods_id'=>$g.goods_id])}"><span class="thumb size40"><i></i><img src="{:goods_thumb($g, 240)}"  onload="javascript:ResizeImage(this,40,40);"></span></a>
                                        <p><span class="thumb size100"><i></i><img src="{:goods_thumb($g, 240)}" onload="javascript:ResizeImage(this,100,100);" title="{$g.goods_name}"><big></big><small></small></span></p>
                                    </dd>
                                    <dd class="price pngFix">{:ds_price_format($g['goods_promotion_price'])}</dd>
                                </dl>
                            </li>
                            {/foreach}
                        </ol>
                    </div>
                    <a href="{:url('Membergoodsbrowse/listinfo')}" class="dsh-sidebar-all-viewed">{$Think.lang.full_browsing_history}</a> </div>
            </div>
            {/if}
        </div>
    </div>

    <form id="buynow_form" method="post" action="{:url('Buy/buy_step1')} ">
        <input id="cart_id" name="cart_id[]" type="hidden"/>
    </form>

</div>
<script src="{$Think.PLUGINS_SITE_ROOT}/jquery.SuperSlide.2.1.1.js"></script>
<script>
    jQuery(".intro_r").slide({titCell:".mb ul",mainCell:".mc ul",autoPage:true,effect:"top",vis:2,trigger:"click"});
</script>
<script type="text/javascript" src="{$Think.PLUGINS_SITE_ROOT}/jquery.lazyload.min.js"></script>
<script src="{$Think.BASE_SITE_ROOT}/static/home/default/store/styles/{$store_theme}/js/jquery.jqzoom.js"></script>
<script src="{$Think.PLUGINS_SITE_ROOT}/jquery.ajaxContent.pack.js"></script>
<script>
    $("img.lazyload").lazyload({
        effect: "fadeIn",
        placeholder:"{$Think.HOME_SITE_ROOT}/images/loading.gif"
    });
    $(function () {
        /*商品缩略图放大镜*/
        $(".jqzoom").jqueryzoom({
            xzoom: 450,
            yzoom: 450,
            offset: 1,
            position: "right",
            preload: 1,
            lens: 1
        });
        //初始化对比按钮
        initCompare()
    });
    //收藏分享处下拉操作
    jQuery.divselect = function(divselectid,inputselectid) {
        var inputselect = $(inputselectid);
        $(divselectid).mouseover(function(){
            var ul = $(divselectid+" ul");
            ul.slideDown("fast");
            if(ul.css("display")=="none"){
                ul.slideDown("fast");
            }
        });
        $(divselectid).on('mouseleave',function(){
            $(divselectid+" ul").hide();
        });
    };
    $(function(){


        {if condition="$goods.goods_state eq '1' && $goods.goods_storage gt 0"}
        // 加入购物车
        $('a[dstype="addcart_submit"]').click(function(){
            if (typeof(allow_buy) != 'undefined' && allow_buy === false) return ;
            var buy_goods_quantity = checkQuantity();
            if(buy_goods_quantity>0){
                addcart({$goods.goods_id}, buy_goods_quantity,'addcart_callback');
            }
        });
        // 立即购买
        $('a[dstype="buynow_submit"]').click(function(){
            if (typeof(allow_buy) != 'undefined' && allow_buy === false) return ;
            var buy_goods_quantity = checkQuantity();
            if(buy_goods_quantity>0){
                buynow({$goods.goods_id},buy_goods_quantity);
            }
        });
        {/if}


        // 规格选择
        $('dl[dstype="ds-spec"]').find('a').each(function(){
            $(this).click(function(){
                if ($(this).hasClass('hovered')) {
                    return false;
                }
                $(this).parents('ul:first').find('a').removeClass('hovered');
                $(this).addClass('hovered');
                checkSpec();
            });
        });

    });
    function checkSpec() {
        var spec_param = {$spec_list};
        var spec = new Array();
        $('ul[nctyle="ul_sign"]').find('.hovered').each(function(){
            var data_str = ''; eval('data_str =' + $(this).attr('data-param'));
            spec.push(data_str.valid);
        });
        spec1 = spec.sort(function(a,b){
            return a-b;
        });
        var spec_sign = spec1.join('|');
        $.each(spec_param, function(i, n){
            if (n.sign == spec_sign) {
                window.location.href = n.url;
            }
        });
    }

    // 验证购买数量
    function checkQuantity(){
        var quantity = parseInt($("#quantity").val());
        if (quantity < 1) {
            layer.msg("{$Think.lang.goods_index_pleaseaddnum}");
            $("#quantity").val('1');
            return false;
        }
        max = parseInt($('[dstype="goods_stock"]').text());
        if(quantity > max){
            layer.msg("{$Think.lang.goods_index_add_too_much}");
            return false;
        }
        return quantity;
    }
    // 立即购买js
    function buynow(goods_id,quantity){

        {if $Think.session.is_login !== '1'}
        login_dialog();
        {else/}
        if (!quantity) {
            return;
        }
        {if $Think.session.store_id == $goods.store_id}
        layer.msg('{$Think.lang.cannot_buy_own_store_goods}');return;
        {/if}
        $("#cart_id").val(goods_id+'|'+quantity);
        $("#buynow_form").submit();
        {/if}
    }

    $(function(){

        $("#salelog_demo").load("{:url('Goods/salelog',['goods_id'=>$goods.goods_id,'store_id'=>$goods.store_id])}", function(){
            // Membership card
            $(this).find('[dstype="mcard"]').membershipCard({type:'shop'});
        });
        $("#consulting_demo").load("{:url('Goods/consulting',['goods_id'=>$goods.goods_id,'store_id'=>$goods.store_id])}", function(){
            // Membership card
            $(this).find('[dstype="mcard"]').membershipCard({type:'shop'});
        });

        /** goods.php **/
        // 商品详情默认情况下显示全部
        $('#tabGoodsIntro').click(function(){
            $('.bd').css('display','none');
            $('#dsGoodsIntro').css('display','');
            $('.hd').css('display','none');
        });
        // 点击评价隐藏其他以及其标题栏
        $('#tabGoodsRate').click(function(){
            $('.bd').css('display','none');
            $('#dsGoodsRate').css('display','');
            $('.hd').css('display','none');
        });
        // 点击成交隐藏其他以及其标题
        $('#tabGoodsTraded').click(function(){
            $('.bd').css('display','none');
            $('#dsGoodsTraded').css('display','');
            $('.hd').css('display','none');
        });
        // 点击咨询隐藏其他以及其标题
        $('#tabGuestbook').click(function(){
            $('.bd').css('display','none');
            $('#dsGuestbook').css('display','');
            $('.hd').css('display','none');
        });
        //商品排行Tab切换
        $(".dss-top-tab > li > a").mouseover(function(e) {
            if (e.target == this) {
                var tabs = $(this).parent().parent().children("li");
                var panels = $(this).parent().parent().parent().children(".dss-top-panel");
                var index = $.inArray(this, $(this).parent().parent().find("a"));
                if (panels.eq(index)[0]) {
                    tabs.removeClass("current ").eq(index).addClass("current ");
                    panels.addClass("hide").eq(index).removeClass("hide");
                }
            }
        });

//触及显示缩略图
        $('.goods-pic > .thumb').hover(
            function(){
                $(this).next().css('display','block');
            },
            function(){
                $(this).next().css('display','none');
            }
        );

        /* 商品购买数量增减js */
        // 增加
        $('a[dstype="increase"]').click(function(){
            num = parseInt($('#quantity').val());
            max = parseInt($('[dstype="goods_stock"]').text());
            if(num < max){
                $('#quantity').val(num+1);
            }
        });
        //减少
        $('a[dstype="decrease"]').click(function(){
            num = parseInt($('#quantity').val());
            if(num > 1){
                $('#quantity').val(num-1);
            }
        });

        //评价列表
        $('#comment_tab').on('click', 'li', function() {
            $('#comment_tab li').removeClass('current');
            $(this).addClass('current');
            load_goodseval($(this).attr('data-type'));
        });
        load_goodseval('all');
        function load_goodseval(type) {
            var url = "{:url('Goods/comments',['goods_id'=>$goods.goods_id])}";
            url += '?type=' + type;
            $("#goodseval").load(url, function(){
                $(this).find('[dstype="mcard"]').membershipCard({type:'shop'});
            });
        }

        //记录浏览历史
        $.get("{:url('Goods/addbrowse',['gid'=>$goods.goods_id])}");


        // 满即送、加价购显示隐藏
        $('[dstype="show-rule"]').click(function(){
            $(this).parent().find('[dstype="rule-content"]').show();
        });
        $('[dstype="hide-rule"]').click(function(){
            $(this).parents('[dstype="rule-content"]:first').hide()
        });

        $('.dss-buy').bind({
            mouseover:function(){$(".dss-point").show();},
            mouseout:function(){$(".dss-point").hide();}
        });

    });

    /* 加入购物车后的效果函数 */
    function addcart_callback(data){
        $('#bold_num').html(data.num);
        $('#bold_mly').html(price_format(data.amount));
        $('.dss-cart-popup').fadeIn('fast');
    }




    //缩略图切换
    $('.small-pic-li').each(function(i, o) {
        var lilength = $('.small-pic-li').length;
        $(o).hover(function() {
            $(o).siblings().removeClass('active');
            $(o).addClass('active');
            $('#zoomimg').attr('src', $(o).find('img').attr('data-img'));
            $('#zoomimg').attr('jqimg', $(o).find('img').attr('data-big'));
            $('.next-btn').removeClass('disabled');
            if (i == 0) {
                $('.next-left').addClass('disabled');
            }
            if (i + 1 == lilength) {
                $('.next-right').addClass('disabled');
            }
        });
    })

    //前一张缩略图
    $('.next-left').click(function() {
        var newselect = $('.small-pic>.active').prev();
        if(!newselect.length){
            return;
        }
        $('.small-pic>.active').removeClass('active');
        $(newselect).addClass('active');
        $('#zoomimg').attr('src', $(newselect).find('img').attr('data-img'));
        $('#zoomimg').attr('jqimg', $(newselect).find('img').attr('data-big'));
        var index = $('.small-pic>li').index(newselect);
        if (index == 0) {
            $('.next-left').addClass('disabled');
        }
        $('.next-right').removeClass('disabled');
    })

    //后前一张缩略图
    $('.next-right').click(function() {
        var newselect = $('.small-pic>.active').next();
        if(!newselect.length){
            return;
        }
        $('.small-pic>.active').removeClass('active');
        $(newselect).addClass('active');
        $('#zoomimg').attr('src', $(newselect).find('img').attr('data-img'));
        $('#zoomimg').attr('jqimg', $(newselect).find('img').attr('data-big'));
        var index = $('.small-pic>li').index(newselect);
        if (index + 1 == $('.small-pic>li').length) {
            $('.next-right').addClass('disabled');
        }
        $('.next-left').removeClass('disabled');
    })

    /**
     * 加减数量
     * n 点击一次要改变多少
     * maxnum 允许的最大数量(库存)
     * number ，input的id
     */
    function altergoodsnum(n) {
        var num = parseInt($('#quantity').val());
        var maxnum = parseInt($('#quantity').attr('max'));
        num += n;
        num <= 0 ? num = 1 : num;
        if (num >= maxnum) {
            $(this).addClass('no-mins');
            num = maxnum;
        }
        $('#store_count').text(maxnum - num); //更新库存数量
        $('#quantity').val(num)
    }

</script>

{/block}
